import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "@/views/Layout.vue";
import Login from "@/views/Login.vue";
import Register from "@/views/Register.vue";
import Article from "@/views/Article.vue";
import Collect from "@/views/Collect.vue";
import Like from "@/views/Like.vue";
import User from "@/views/User.vue";
import Detail from "@/views/Detail.vue";
import { List } from "vant";

Vue.use(List);

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        {
          path: "/article",
          component: Article,
        },
        {
          path: "/collect",
          component: Collect,
        },
        {
          path: "/like",
          component: Like,
        },
        {
          path: "/user",
          component: User,
        },
      ],
    },
    {
      path: "/login",
      component: Login,
    },
    {
      path: "/register",
      component: Register,
    },
    {
      path: "/detail",
      component: Detail,
    },
  ],
});

export default router;
